package com.cn.unarmed.activity;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;

import com.cn.unarmed.adapter.SwipeItemAdapter;
import com.cn.unarmed.commonutils.AppUtils;

import java.util.ArrayList;
import java.util.List;

public class SwipeItemActivity extends Activity {

    private ListView listView;
    private SwipeItemAdapter adapter;
    private List<String> list;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_swipe_item);

        initView();
    }

    private void initView() {
        listView = (ListView) this.findViewById(R.id.swipe_list);
        list = new ArrayList<>();
        for (int i = 0; i < 7; i++) {
            list.add("我tm就试试" + i);
        }
        adapter = new SwipeItemAdapter(this,list);
        listView.setAdapter(adapter);
        adapter.setOnItemClickListener(new SwipeItemAdapter.ZwipeAdapterOnClickListener() {
            @Override
            public void OnClick(String mode) {
                AppUtils.showToast(SwipeItemActivity.this,"我tm被点了",true);
            }

            @Override
            public void OnDelete(String mode) {
                AppUtils.showToast(SwipeItemActivity.this,"我tm要被删了",true);
            }

            @Override
            public void OnStatusChage(boolean b, String mode) {
                AppUtils.showToast(SwipeItemActivity.this,"戳了一下",b);
            }
        });
    }
}
